package ink.onei.production.service.impl;

import ink.onei.production.entity.Customer;
import ink.onei.production.mapper.ICustomerMapper;
import ink.onei.production.service.ICustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: nekotako
 * @Description: TODO
 * @Date: 26/12/2023 20:51 Tuesday
 */

@Service
public class CustomerService implements ICustomerService {

    @Autowired
    private ICustomerMapper customerMapper;

    @Override
    public Integer add(Customer customer) {
        return customerMapper.insert(customer);
    }

    @Override
    public Integer modify(Customer customer) {
        return customerMapper.update(customer);
    }

    @Override
    public Integer delete(Customer customer) {
        return customerMapper.delete(customer);
    }

    @Override
    public Integer deleteBatch(List<Customer> customerList) {
        return customerMapper.deleteBatch(customerList);
    }

    public Customer getCustomer(Customer customer) {
        return customerMapper.getCustomer(customer);
    }

    @Override
    public List<Customer> getCustomerList(Integer id, String name, String fullName, String fax, String mail, String manager, String address, String phone, String status) {
        return customerMapper.getCustomerList(id, name, fullName, fax, mail, manager, address, phone, status);
    }
}
